<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>预约分类</title>
<link href="./public/core/admin/css/base.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>
<body background='img/allbg.gif' leftmargin='8' topmargin='8'>
<div class="bodytitle">
	<div class="bodytitleleft"></div>
  <div class="bodytitletxt"><a href='../yuyue' target='_blank'><b>在线预约模块</b></a> -- 预约科室分类</div>
</div>
<?php
if(empty($action))
{
?>
<form name="form2" action="?do=yuyue_type" method="post">
	<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;margin-bottom:6px;">
      <tr>
        <td colspan="2" bgcolor="#EDF9D5" background="img/wbg.gif"><strong>&nbsp;添加科室分类</strong>
        <input type="hidden" name="action" value="add" /></td>
      </tr>
      <tr>
        <td width="150" height="20" align="right" bgcolor="#FFFFFF">科室/病种名称：</td>
        <td height="20" bgcolor="#FFFFFF"><input type="text" name="name" value=""  />(分类名称长度最好不要超过7个汉字)</td>
      </tr>
      <tr>
        <td height="20" align="right" bgcolor="#FFFFFF">
        	隶属科室：
        </td>
        <td height="20" bgcolor="#FFFFFF">
        <select name="fid" style="width:150px;">
          <option value="0">无(作为一级分类)</option>
          <?php echo $sectorscache; ?>
        </select>(科室为一级，病种为二级)
        </td>
      </tr>
      <tr>
        <td height="35" bgcolor="#FFFFFF">&nbsp;</td>
        <td height="20" bgcolor="#FFFFFF"><input type="submit" name="submit2" value="提交" class="np coolbg"/></td>
      </tr>
    </table>
</form>
<form name="form3" action="?do=yuyue_type" method="post">
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
	<tr>
        <td bgcolor="#EDF9D5" background="img/wbg.gif"><strong>&nbsp;编辑分类</strong>
		<input type="hidden" name="action" value="update"/></td>
	</tr>
	<tr>
        <td bgcolor="#FFFFFF">
		<table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" style="margin:0px auto" class="tblist">
		 <tr height="18">
            <td>id</td>
            <td>分类名称</td>
			<td width="300">医生(小逗号均可)</td>
			<td>排序</td>
            <td >管理操作</td>
          </tr>
<?php
foreach($sectors as $sector)
{
	if($sector['fid'] == 0)
	{
		echo "<tr height=\"20\" style=\"color:blue\"><td>$sector[id]</td><td><input type=\"text\" name=\"names[$sector[id]]\" value=\"$sector[name]\" style=\"color:blue\" /></td><td>&nbsp;</td><td><input type=\"text\" name=\"disorders[$sector[id]]\" value=\"$sector[disorder]\" style='width:20px'/></td><td><a href=\"?do=yuyue_type&action=edit&amp;id=$sector[id]\">修改</a> <a href=\"?do=yuyue_type&action=delete&amp;id=$sector[id]\">删除</a></td></tr>";
	}else
	{
		echo "<tr height=\"18\"><td>$sector[id]</td><td>|- <input type=\"text\" name=\"names[$sector[id]]\" value=\"$sector[name]\" /></td><td><input type=\"text\" name=\"doctors[$sector[id]]\" value=\"$sector[doctor]\" style=\"width:80%\" /></td><td><input type=\"text\" name=\"disorders[$sector[id]]\" value=\"$sector[disorder]\" style='width:20px' /></td><td><a href=\"?do=yuyue_type&action=edit&amp;id=$sector[id]&amp;doc=yes\">修改</a> <a href=\"?do=yuyue_type&action=delete&amp;id=$sector[id]\">删除</a></td></tr>";

	}
}
?>
        </table> 
       </td>
      </tr>
      <tr>
        <td height="35" align="center" bgcolor="#F8FCF1"><input name="submit3" type="submit" value="提交" class="np coolbg"/></td>
      </tr>
    </table>
</form>
<?php
}elseif($action == 'edit')
{
?>
<form name="form4" action="?do=yuyue_type" method="post">
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
    <tr>
        <td colspan="2" bgcolor="#EDF9D5" background="img/wbg.gif"><strong>&nbsp;修改</strong>
        <input type="hidden" name="action" value="edit" />
        <input type="hidden" name="step" value="2" />
        <input type="hidden" name="id" value=<?php echo $id; ?> /></td>
    </tr>
	<tr>
        <td align="right" bgcolor="#FFFFFF">分类名称：</td>
        <td bgcolor="#FFFFFF"><input type="text" name="name" value="<?php echo $sector['name']; ?>" /></td>
    </tr>
    <tr>
        <td width="150" align="right" bgcolor="#FFFFFF">所属科室：</td>
        <td bgcolor="#FFFFFF">
			<select name="fid"><?php echo $sectorscache; ?> </select>      
		</td>
    </tr>
	<?php 
		if($doc=="yes"){
	?>
	<tr>
        <td align="right" bgcolor="#FFFFFF">治疗专家：</td>
        <td bgcolor="#FFFFFF"><input type=text name=doctor value="<?php echo $sector['doctor']; ?>" style='width:35%' />&nbsp;</td>
    </tr>
	<?php
		}
	?>
    <tr>
        <td align="right" bgcolor="#FFFFFF">顺序：</td>
        <td bgcolor="#FFFFFF"><input type=text name=disorder value="<?php echo $sector['disorder']; ?>" style='width:20px'/>&nbsp;</td>
    </tr>
      <tr>
        <td height="35" bgcolor="#FFFFFF">&nbsp;</td>
        <td bgcolor="#F8FCF1"><input name="submit4" type="submit" value="提交" class="np coolbg"/></td>
    </tr>
</table>

<br>
<br>
</form>
<?php
}elseif($action == 'delete')
{
?>
<form action=?do=yuyue_type method=post name=form5>
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
    <tr>
        <td height="20" bgcolor="#EDF9D5" background="img/wbg.gif">
        	<strong>&nbsp;删除分类确认</strong>
          <input type=hidden name=action value=delete />
          <input type=hidden name=step value=2 />
          <input type=hidden name=id value=<?php echo $id; ?> />
        </td>
    </tr>
      <tr>
        <td height="60" align="center" bgcolor="#FFFFFF">
        	<span class="STYLE1">删除分类时将删除该行业的所有下级分类，且不能恢复操作，请确认删除！</span>
        </td>
    </tr>
      <tr>
        <td height="35" align="center" bgcolor="#FFFFFF">
        <input name="submit5" type="submit" value="确认删除" class="np coolbg" />
        <input type='button' value='返 回 继 续 操 作' onclick='javascript:history.go(-1);'  class="np coolbg" />
       </td>
    </tr>
    </table>
</form>
<?php
}
?>
</body>
</html>